import * as types from '../_types/exchangeBalance';

export function updateBalanceInfo (balanceInfo) {
    return {
        type: types.EXCHANGE_UPDATE_BALANCEINFO,
        payload: balanceInfo
    }
}

export type IFuncUpdateExchangeBalanceInfo = typeof updateBalanceInfo;

export function delBalanceInfo () {
    return {
        type: types.EXCHANGE_DEL_BALANCEINFO,
    }
}

/**
 * 买入/卖出/转到银行 等操作之后更新状态
 * @param coinType 
 * @param amount 
 */
export function updateBalanceInfoWithCoinType (coinType: string, amount: number) {
    return {
        type: types.EXCHANGE_UPDATE_BALANCEINFO_WITH_COINTYPE,
        payload: {
            coinType,
            amount,
        }
    }
}